Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of TRT wrapping via inference.json #620

Merged
merged 38 commits into from
Sep 10, 2024

Conversation

borisfom
Copy link
Contributor

Sample implementation of using new trt_wrap() from MONAI
Depends on Project-MONAI/MONAI#7990

@borisfom
Copy link
Contributor Author

I observe 2.5x speedup with FP16 TRT for a small sample (28.57it/s vs 11it/s). Did not check the accuracy.

@borisfom borisfom changed the title POC implementation of TRT wrapping via inference.json Implementation of TRT wrapping via inference.json Aug 27, 2024
@borisfom
Copy link
Contributor Author

borisfom commented Sep 6, 2024

@binliunls : I have merged origin/dev and fixed brats_mri_generative_diffusion and brats_mri_axial_slices_generative_diffusion. Note: for brats_mri_axial_slices_generative_diffusion, default
python -m monai.bundle run --config_file "['configs/inference.json', 'configs/inference_trt.json']" does not get to the diffusion forward, so no TRT is generated, and there may be issues with it. Let me know how to run it so that the diffusion actually gets executed.

@borisfom borisfom mentioned this pull request Sep 6, 2024
8 tasks
@binliunls
Copy link
Contributor

@binliunls : I have merged origin/dev and fixed brats_mri_generative_diffusion and brats_mri_axial_slices_generative_diffusion. Note: for brats_mri_axial_slices_generative_diffusion, default python -m monai.bundle run --config_file "['configs/inference.json', 'configs/inference_trt.json']" does not get to the diffusion forward, so no TRT is generated, and there may be issues with it. Let me know how to run it so that the diffusion actually gets executed.

Hi @borisfom ,
Thank you for your update. As shown in the inference config file, you should compile the diffusion and autoencoder with TRT instead of network, since the network parameter is not defined in either bundle. Please check if you can compile both diffusion and autoencoder.

Thanks,
Bin

@borisfom
Copy link
Contributor Author

borisfom commented Sep 6, 2024

@binliunls : Thanks, you are correct! Works as expected now.

Signed-off-by: Yiheng Wang <[email protected]>
@yiheng-wang-nv
Copy link
Collaborator

/build

Signed-off-by: Yiheng Wang <[email protected]>
@yiheng-wang-nv
Copy link
Collaborator

/build

@yiheng-wang-nv
Copy link
Collaborator

/build

Signed-off-by: Yiheng Wang <[email protected]>
@yiheng-wang-nv
Copy link
Collaborator

/build

Signed-off-by: Yiheng Wang <[email protected]>
@yiheng-wang-nv
Copy link
Collaborator

/build

1 similar comment
@yiheng-wang-nv
Copy link
Collaborator

/build

@yiheng-wang-nv yiheng-wang-nv enabled auto-merge (squash) September 10, 2024 06:28
@yiheng-wang-nv yiheng-wang-nv merged commit efadc57 into Project-MONAI:dev Sep 10, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants